<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title></title>
  <script src="https://cdn.bootcss.com/react/16.4.0/umd/react.development.js"></script>
  <script src="https://cdn.bootcss.com/react-dom/16.4.0/umd/react-dom.development.js"></script>
  <script src="https://cdn.bootcss.com/babel-standalone/6.26.0/babel.min.js"></script>
</head>

<body>
  <div id="root">

  </div>
</body>

</html>

<script type="text/babel">
    class Demo extends React.Component {
      constructor(props) {
          super(props);
          // 让函数的this指向class的实例
          this.handleClick = this.handleClick.bind(this);
      }

      handleClick (){
        this.getList();
      }

      getList() {
          alert('获取列表数据');
      }

      render() {
        return (
            <div>
                <button onClick={this.handleClick}>
                click
              </button>
            </div>
        );
      }
    }

ReactDOM.render(
    <Demo />,
    document.getElementById('root')
)
</script>